<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	  layout:decorate="layout/admin_main">
<!-- BEGIN HEAD -->
<head>
<title>运营中心  | 管理员编辑</title>
</head>
<body th:with="cur='sel-sys',cur_sub='sel-admin'">

<th:block layout:fragment="content">
<div class="page-content-wrapper">
	<div class="portlet page-content">

		<div class="row">
			<div class="col-md-12">
				<ul class="page-breadcrumb breadcrumb">
					<li><i class="fa fa-home"></i> <a href="/admin/index.shtml">首页</a> <i class="fa fa-angle-right"></i></li>
					<li>管理员编辑</li>
				</ul>
				<!-- END PAGE TITLE & BREADCRUMB-->
			</div>
		</div>

		<div class="portlet-body form">
			<!-- BEGIN FORM-->
			<form action="updateSystemAdmin.shtml" class="form-horizontal" method="post" id="submitForm">
				<input type="hidden" name="id" th:value="${admin?.id}"/>
				<input type="hidden" name="oldPassword" th:value="${admin?.password}"/>
				<div class="form-body">

					<div class="form-group first">
						<label class="col-md-3 control-label"><span style="color:red">*</span>账号</label>
						<div class="col-md-4">
								<p class="form-control-static" th:if="${admin != null && admin.id != null}" th:text="${admin?.account}">
								</p>
							<input th:if="${admin == null || admin.id == null}" name="account" class="form-control" placeholder="账号" maxlength="50" th:value="${admin?.account}"/>
						</div>
					</div>
					
					<div class="form-group">
						<label class="col-md-3 control-label">密码</label>
						<div class="col-md-4">
						<input name="password" class="form-control" placeholder="密码" maxlength="50" type="password"/>
						</div>
					</div>
					
					<div class="form-group">
						<label class="col-md-3 control-label"><span style="color:red">*</span>角色</label>
						<div class="col-md-4">
							<select class="form-control" name="roleId">
								<option value="">请选择角色</option>
								<option th:each="role:${roles}" th:value="${role.id}" th:selected="${admin?.roleId == role.id}" th:text="${role.name}"></option>
							</select>
						</div>
					</div>

					<div class="form-group">
						<label class="col-md-3 control-label">状态</label>
						<div class="col-md-4">
							<div class="radio-list">
								<label class="radio-inline">
									<div class="radio"><span><input type="radio" name="status" value="ENABLE" th:checked="${role == null || role.status == null || role.status == 'ENABLE'}"></span>启用</div>
								</label>
								<label class="radio-inline">
									<div class="radio"><span><input type="radio" name="status" value="DISABLE" th:checked="${role != null && role.status == 'DISABLE'}"></span>禁用</div>
								</label>
							</div>
						</div>
					</div>

				</div>
				<div class="form-actions fluid">
					<div class="col-md-offset-3 col-md-9">
						<button type="submit" class="btn blue">提交</button>
						<button type="button" class="btn default goback">取消</button>
					</div>
				</div>
			</form>
			<!-- END FORM-->
		</div>
	</div>
</div>

<script src="/admin/js/admin.js?v=${version}" type="text/javascript"></script>
<script src="/common/js/goback.js?v=${version}" type="text/javascript"></script>
<script>
	$(function() {
		Admin.init();
	});
</script>
	<div th:replace="/common/bootbox"></div>
</th:block>
</body>
</html>